% binary vector transform to decimal vector
function dec_vector_out = binary_to_dec_vector(vector_in)
global digits;
global dimension;

dec_vector_out = zeros(1, dimension);
integral_total = 0;
fractional_total = 0;
integral_digits = digits * 0.6;
fractional_digits = digits * 0.4;

for dimen = 1:dimension
    for digit = integral_digits:-1:1
        integral_total = integral_total + vector_in((dimen-1) * digits + digit)...
                             * 2^(integral_digits - digit);
    end
    for digit = 1:fractional_digits
        fractional_total = fractional_total + ...
            vector_in((dimen-1) * digits + integral_digits + digit) * 2^(-digit);
    end
    total = integral_total + fractional_total;
    dec_vector_out(dimen) = total;
end

end